part of 'header.dart';

class NewsView extends StatelessWidget {
  const NewsView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: gap12),
      child: Column(
        children: const [
          TitleContentItemView(title: '新闻资讯', content: '查看更多'),
          TripView()
        ],
      ),
    );
  }
}

class TripView extends StatelessWidget {
  const TripView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: BorderRadius.circular(circle4),
      child: Column(
        children: [
          imageView(),
          Container(
            padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 15.w),
            color: ColorsUtil.textBg,
            child: Column(
              children: [
                indexText(Text(
                  '产品更新：新增“一键扫码、创建多种角色、田头市 场农户报价询价”等六项功能',
                  style:
                      pfMediumStyle(color: ColorsUtil.title, fontSize: font14),
                )),
                SizedBox(
                  height: 10.w,
                ),
                indexText(Text(
                  '如何在田头市场中发布求购信息',
                  style:
                      pfMediumStyle(color: ColorsUtil.title, fontSize: font14),
                ))
              ],
            ),
          )
        ],
      ),
    );
  }

  Widget imageView() {
    return Stack(
      children: [
        Positioned(
            child: ClipRRect(
          borderRadius: BorderRadius.only(topRight: Radius.circular(4.w)),
          child: loadImage(width: 351.w, height: 114.w),
        )),
        Positioned(
            child: Container(
          padding: EdgeInsets.fromLTRB(10.w, 5.w, 12.w, 5.w),
          decoration: BoxDecoration(
              color: const Color(0xffefaf05),
              borderRadius:
                  BorderRadius.only(bottomRight: Radius.circular(11.5.w))),
          child: Text(
            '新手必读',
            style: pfMediumStyle(color: Colors.white, fontSize: font12),
          ),
        )),
      ],
    );
  }

  Widget indexText(Text text) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          width: 3.5.w,
          height: 3.5.w,
          color: ColorsUtil.content,
          margin: EdgeInsets.only(top: 7.w),
        ),
        SizedBox(
          width: 10.w,
        ),
        Expanded(child: text)
      ],
    );
  }
}
